<html>
    <head>
        <title>原材料列表</title>
        <link href="{$Think.const.ADMIN_CSS_URL}bootstrap.css" rel="stylesheet" />
        <link href="{$Think.const.ADMIN_CSS_URL}lz-style.css" rel="stylesheet" />
        <script src="{$Think.const.ADMIN_JS_URL}jquery.js"></script>
        <script src="{$Think.const.ADMIN_JS_URL}bootstrap.js"></script>
        <script src="{$Think.const.ADMIN_JS_URL}dataTables/jquery.dataTables.js"></script>
        <script src="{$Think.const.ADMIN_JS_URL}dataTables/dataTables.bootstrap.js"></script>
        <script src="{$Think.const.ADMIN_JS_URL}DatePicker/WdatePicker.js"></script>
        <script>
            $(document).ready(function () {
                $('#dataTables').dataTable({
                    paging: true,
                    searching: false,
                    showrownumber: true
                });
            });
        </script>
    </head>
    <body>
        <div class="container">
            <div class="row div_head" >
                <div class=" col-xs-6 col-sm-6 text-primary">
                    {$loction}
                </div>
                <div class=" col-xs-6 col-sm-3"></div>
                <div class=" col-xs-6 col-sm-3">
                    <a style="text-decoration: none;" href="__CONTROLLER__/add">【添加】</a>
                </div>
            </div>
            <hr />
            <div class="row div_form" >
                <form action="__SELF__" method="post">
                    <div class="text-right col-xs-6 col-sm-3 " ><label for="MaterialCode" class="control-label">{$Think.const.LB_MATERIALCODE}:</label></div>
                    <div class="col-xs-6 col-sm-3 div_text" >
                        <input type="text" id="MaterialCode" name="MaterialCode" class="form-control" placeholder="{$Think.const.LB_MATERIALCODE}"  value="" maxlength="42"/>
                    </div>
                    <div class="text-right col-xs-6 col-sm-3 " ><label for="MaterialName" class="control-label">{$Think.const.LB_MATERIALNAME}:</label></div>
                    <div class="col-xs-6 col-sm-3 div_text" >
                        <input type="text" id="MaterialName" name="MaterialName" class="form-control" placeholder="{$Think.const.LB_MATERIALNAME}"  value="" maxlength="100"/>
                    </div>
                    <div class="text-right col-xs-6 col-sm-3 " ><label for="MaterialTypeID" class="control-label">{$Think.const.LB_MATERIALTYPEID}:</label></div>
                    <div class="col-xs-6 col-sm-3 div_text" >
                        <input type="text" id="MaterialTypeID" name="MaterialTypeID" class="form-control" placeholder="{$Think.const.LB_MATERIALTYPEID}"  value="" maxlength="42"/>
                    </div>



                    <div class="col-xs-6 col-sm-3">
                        <input type="submit" id="search"  class="btn btn-default" value="查询">
                    </div>

                </form>
                <div id="error" class="row text-danger"></div>
                <div id="success" class="row text-success"></div>
            </div>
            <hr />
            <div class="row div_content" >
                <div class="col-md-12">
                    <div class="table-responsive">
                        <table class="table table-striped table-bordered table-hover table-condensed" id="dataTables" border="1">
                            <thead>
                                <tr>
                                    <th class="div_tab_head">序号</th>


                                    <th class="div_tab_head">{$Think.const.LB_MATERIALCODE}</th>

                                    <th class="div_tab_head">{$Think.const.LB_MATERIALNAME}</th>

                                    <th class="div_tab_head">{$Think.const.LB_MATERIALTYPEID}</th>

                                    <th class="div_tab_head">{$Think.const.LB_MATERIALMODEL}</th>

                                    <th class="div_tab_head">{$Think.const.LB_MATERIALUNIT}</th>

                                    <th class="div_tab_head">{$Think.const.LB_MATERIALIMG}</th>

                                    <th class="div_tab_head">{$Think.const.LB_MATERIALSIMG}</th>

                                    <th class="div_tab_head">{$Think.const.LB_MATERIALDESC}</th>

                                    <th class="div_tab_head">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            <foreach name="lst" item="row" >
                                <tr>
                                    <td class="div_tab_cell">{$key+1}</td>

                                    <td class="div_tab_cell div_tab_cell_text">{$row.materialcode|stripcslashes}</td>
                                    <td class="div_tab_cell div_tab_cell_text">{$row.materialname|stripcslashes}</td>
                                <assign name="var_materialtypeid" value="$row.materialtypeid" />
                                <td class="div_tab_cell div_tab_cell_text">{$LSTMATERIALTYPEID.$var_materialtypeid|stripcslashes}</td>
                                <td class="div_tab_cell div_tab_cell_text">{$row.materialmodel|stripcslashes}</td>

                                <assign name="var_materialunit" value="$row.materialunit" />
                                <td class="div_tab_cell div_tab_cell_text">{$GV_Enum.MaterialUnit.$var_materialunit|stripcslashes}</td>
                                <td class="div_tab_cell div_tab_cell_text">{$row.materialimg|stripcslashes}</td>
                                <td class="div_tab_cell div_tab_cell_text">{$row.materialsimg|stripcslashes}</td>
                                <td class="div_tab_cell div_tab_cell_text">{$row.materialdesc|stripcslashes}</td>

                                <td align="center" class="div_tab_cell"><div class="btn-group">
                                        <a id="edit" type="button" class="btn btn-default" href="__CONTROLLER__/edit/MaterialID/{$row.materialid}"><span class="glyphicon glyphicon-pencil"></span></a>
                                        <a id="delete" type="button" class="btn btn-default"href="__CONTROLLER__/del/MaterialID/{$row.materialid}" onClick="if (confirm('确定要删除吗？'))
                                                        return true;
                                                    else
                                                        return false;"><span class="glyphicon glyphicon-remove"></span></a>
                                    </div></td>
                                </tr>
                            </foreach>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>

    </body>
</html>
